class editOperationsCostHolderBase {
public:
	virtual double deletionCost( char /*symbBeforeInsertion*/, char /*insertion*/ ) const { return 1.0; }
	virtual double insertionCost( char /*symbBeforeInsertion*/, char /*insertion*/ ) const { return 1.0; }
	virtual double substitutionCost( char source, char target ) const { return source == target ? 0.0 : 1.0; }
	virtual double transpositionCost( char source, char target ) const { return source == target ? 0.0 : 1.0; }

	editOperationsCostHolderBase() {}
	virtual ~editOperationsCostHolderBase() {}
};

class keyboardErrorsCostHolder : public editOperationsCostHolderBase {
public:
	keyboardErrorsCostHolder() : penaltyRelief( 0.1 ) {}
	virtual double deletionCost( char symbAfterDeletion, char deletion ) const;
	virtual double insertionCost( char symbBeforeInsertion, char insertion ) const;
	virtual double substitutionCost( char source, char target ) const;
	virtual double transpositionCost( char source, char target ) const { return source == target ? 0.0 : 1.0 - penaltyRelief; }
private:
	const double penaltyRelief;
};

class phoneticErrorsCostHolder: public editOperationsCostHolderBase {
public:
  virtual double deletionCost( char /*symbAfterDeletion*/, char /*deletion*/ ) const;
  virtual double insertionCost( char symbBeforeInsertion, char insertion ) const;
  virtual double substitutionCost( char source, char target ) const;
  virtual double transpositionCost( char source, char target ) const; 
};
